<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>Fiche d'une personne</title>
	<link rel="stylesheet" type="text/css" href="style.css" />

	<f:metadata>
		<f:viewParam name="id" value="#{beanPersonne.idCourant}"
			required="false" />
	</f:metadata>
</h:head>

<h:body>

	<div id="header">
		<ui:include src="header.xhtml" />
	</div>
	<div class="bobine minH" />
	<div id="contenu" class="minH">
		<h:panelGrid styleClass="form inscription"
			rendered="#{beanUtilisateur.isLoggedIn() == false}">
			<ui:include src="demandeConnexion.xhtml" />
		</h:panelGrid>


				<h:panelGroup rendered="#{beanUtilisateur.isLoggedIn() == true}">
				<div class="imgProfil">
					<img src="#{beanPersonne.personne.image}" width="200" />
				</div>
				<div class="infoGenerales">
					<h1>
						<h:outputLabel value="#{beanPersonne.personne.prenom} " />
						<h:outputLabel value="#{beanPersonne.personne.nom}" />
					</h1>
					<br /> <br />
					<h:outputLabel value="#{nomColonnes['label.dateNaissance']}" />
					<h:outputLabel value="#{beanPersonne.personne.dateNaissance}">
						<f:convertDateTime type="date" pattern="dd/MM/yyyy" />
					</h:outputLabel>
					<br />
					<h:outputLabel value="#{nomColonnes['label.popularite']}" />
					<h:outputLabel value="#{beanPersonne.personne.popularite}" />
					<br />
				</div>

				<div class="divTable">
					<h2>Recompenses :</h2>
					<h:dataTable value="#{beanPersonne.personne.listeRecompenses}"
						var="recompense" class="table">
						<h:column>
							<h:outputText value="#{recompense.annee}" />
						</h:column>
						<h:column>
							<h:outputText value="#{recompense.raison}" />
						</h:column>
						<h:column>
							<h:outputText value="#{recompense.type}" />
						</h:column>
						<h:column>
							<h:outputText value="#{recompense.film.titre}" />
						</h:column>


					</h:dataTable>
				</div>

				<div class="divTable">
					<h2>Productions :</h2>
					<h:dataTable value="#{beanPersonne.personne.listeFilmProduits}" var="film"
						title="Productions" class="table">
						<h:column>
								<h:outputLink value="ficheFilm.xhtml">
								<f:param name="id" value="#{film.id}" />
								<h:outputText value="#{film.titre}" />
								</h:outputLink>
							</h:column>
							<!-- 	<h:column>
								<h:outputText value="#{beanRole.role}"/>
							</h:column> -->
							<h:column>
								<h:outputText value="#{film.annee}">
									<f:convertDateTime type="date" pattern="yyyy" />
								</h:outputText>
							</h:column>
					</h:dataTable>
				</div>


				<div class="divTable">
					<h2>Réalisations :</h2>
					<h:dataTable value="#{beanPersonne.personne.listeFilmRealises}" var="film"
						title="Productions" class="table">
						<h:column>
								<h:outputLink value="ficheFilm.xhtml">
								<f:param name="id" value="#{film.id}" />
								<h:outputText value="#{film.titre}" />
								</h:outputLink>
						</h:column>
						<h:column>
								<h:outputText value="#{film.annee}">
									<f:convertDateTime type="date" pattern="yyyy" />
								</h:outputText>
						</h:column>
					</h:dataTable>
				</div>


				<div class="divTable">
					<h2>A joué dans :</h2>
					<h:dataTable value="#{beanPersonne.personne.listeFilmJoues}" var="film"
						title="Productions" class="table">
						
							<h:column>
								<h:outputLink value="ficheFilm.xhtml">
								<f:param name="id" value="#{film.id}" />
								<h:outputText value="#{film.titre}" />
								</h:outputLink>
							</h:column>
						<!-- 	<h:column>
								<h:outputText value="#{beanFilm.roleWithFilm}"/>
							</h:column> -->
							<h:column>
								<h:outputText value="#{film.annee}">
									<f:convertDateTime type="date" pattern="yyyy" />
								</h:outputText>
							</h:column>

						
					</h:dataTable>
				</div>
				
				<h:outputLink value="fichePersonneModif.xhtml"
						rendered="#{beanUtilisateur.isLoggedIn()}">
						<f:param name="idPersonneModif" value="#{beanPersonne.personne.id}" />
						<h:outputText value="#{nomColonnes['label.modif']}   " />
				</h:outputLink>
			</h:panelGroup>

		</div>

	<div class="bobine minH" />

	<div id="footer">Projet réalisé par Aurore Lambin et Pauline
		Fischer</div>
</h:body>

</html>